export const URL = {
  resistEarthquakesDE: 'resistEarthquakesDE',
  casualtiesDE: 'casualtiesDE',
  EconomicLossED: 'EconomicLossED',
  resistEarthquakesPE: 'resistEarthquakesPE',
  casualtiesPE: 'casualtiesPE',
  EconomicLossPD: 'EconomicLossPD',
}
export const TYPE = {
  confirm: 'confirm',
  probability: 'probability'
}
export const CODE = {
  ld: 'ld',
  sgglsz: 'sgglsz',
  rysw: 'rysw',
  sjd: 'sjd',
  phcd: 'pgcd',
  tn: 'tn'
}
export const assessType = [
  { name: '确定评估', value: '0' },
  { name: '概率评估', value: '1' }
]
export const assessObj = [
  { name: '结构破坏', value: '0' },
  { name: '人员伤亡', value: '1' },
  // { name: '人员死亡', value: '2' },
  { name: '经济损失', value: '2' }
]
export const assessObj1 = [
  { name: '结构破坏', value: '0' },
  { name: '人员伤亡', value: '1' },
  { name: '人员死亡', value: '2' },
  { name: '经济损失', value: '3' }
]
export const seismicInputMode = [
  { name: '设定烈度', value: '0' },
  { name: '超越概率', value: '1' },
  { name: '设定地震影响场', value: '2' },
  { name: '发生概率地震危险性', value: '3' },
  { name: '超越概率地震危险性', value: '4' }
]
export const inputMethods = (type) => {
  if (type == 'confirm') {
    return [
      { name: '烈度', value: '0' },
      { name: '超越概率', value: '1' },
      { name: '地震影响场', value: '2' }
    ]
  } else {
    return [
      { name: '发生概率地震危险性', value: '3' },
      { name: '超越概率地震危险性', value: '4' }
    ]
  }
}

export const houseBasicData = [
  { name: '房屋网格数据', value: '1' },
  { name: '房屋单体数据', value: '0' },
]

// 省市区县列表（兼容province-city-county、province|city|county）
export const areaName = (province, city, county) => {
  if (county?.includes('-')) {
    return county
  } else if (city?.includes('-')) {
    return city
  } else {
    if (province && !city && !county) {
      return province;
    } else if (province && city && !county) {
      return province + '-' + city;
    } else {
      return province + '-' + city + '-' + county
    }
  }
}